/*
 * @Description: vipcard
 * @Author: iamsmiling
 * @Date: 2021-06-11 22:33:32
 * @LastEditTime: 2021-06-11 23:46:42
 */
import 'package:credit_business_circle/R/R.dart';
import 'package:credit_business_circle/domain/local/vip/vip_entity.dart';
import 'package:flutter/material.dart';

class VipCard extends StatelessWidget {
  final VipEntity vip;
  final double width;
  final Color color;

  final Color borderColor;
  const VipCard(
      {Key? key,
      required this.vip,
      required this.width,
      required this.color,
      required this.borderColor})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: width,
      padding: EdgeInsets.symmetric(
        vertical: R.dimen.dp18,
      ),
      decoration: BoxDecoration(
          border: Border.all(width: R.dimen.dp2, color: borderColor),
          borderRadius: BorderRadius.circular(R.dimen.sp5),
          color: color),
      child: Column(
        children: [
          Text(
            vip.label,
            style: TextStyle(
                fontSize: R.dimen.sp13,
                color: R.color.ff333333,
                fontWeight: FontWeight.w600),
          ),
          Container(
            margin: EdgeInsets.only(top: R.dimen.dp15, bottom: R.dimen.dp13),
            child: Text.rich(TextSpan(
                text: vip.price,
                style: TextStyle(
                    color: R.color.ffd67a02,
                    fontSize: R.dimen.sp28,
                    fontWeight: FontWeight.w600),
                children: [
                  TextSpan(
                      text: "元",
                      style: TextStyle(
                          fontSize: R.dimen.sp12,
                          fontWeight: FontWeight.normal))
                ])),
          ),
          Text(
            vip.description,
            style: TextStyle(color: R.color.ffeb470e, fontSize: R.dimen.sp12),
          ),
          for (String s in vip.extra)
            Text(
              s,
              style: TextStyle(
                  height: 1.5, color: R.color.ff333333, fontSize: R.dimen.sp12),
            )
        ],
      ),
    );
  }
}
